<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <title>生产追踪</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="icon" th:href="@{/static/console/common/images/favicon.ico}">
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/element/index.css}"/>
    <link rel="stylesheet" type="text/css"
          th:href="@{/static/console/css/production/invoice.css?version=202303231055}"/>
</head>

<body>
<div id="container">
    <el-container>
        <el-header>
            <el-date-picker v-model="tableSearch.startDate"
                            type="datetime"
                            :value-format="tableSearch.dateFormat"
                            placeholder="起始日期">
            </el-date-picker>
            <el-date-picker v-model="tableSearch.endDate"
                            type="datetime"
                            :value-format="tableSearch.dateFormat"
                            placeholder="截止日期">
            </el-date-picker>
            <el-input v-model="tableSearch.conName" placeholder="工程名称" clearable></el-input>
            <el-input v-model="tableSearch.site" placeholder="施工部位" clearable></el-input>
            <el-button type="success" icon="el-icon-search" @click="searchDatas">查询</el-button>
            <el-button type="primary" icon="el-icon-plus" @click="showAddDialog">添加</el-button>
        </el-header>
        <el-main>
            <template>
                <el-table :data="tableDatas" border v-loading="tableLoading" max-height="750">
                    <el-table-column label="序号"
                                     show-overflow-tooltip
                                     type="index"
                                     width="50"></el-table-column>
                    <el-table-column prop="code" show-overflow-tooltip
                                     label="发货单编号"
                                     width="210"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     label="任务单编号"
                                     prop="indentCode"
                                     width="210"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="conName"
                                     label="工程名称"
                                     width="240"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="site"
                                     label="施工部位"
                                     width="240"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="builder"
                                     label="施工单位"
                                     width="240"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="distance"
                                     label="运距(KM)"
                                     width="100"></el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="strengthName"
                                     label="砼强度"
                                     width="180">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="tech"
                                     label="特性要求"
                                     width="180">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="castModelName"
                                     label="浇筑方式"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="sendStere"
                                     label="发货方量(方)"
                                     width="120">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="proTime"
                                     label="生产时间"
                                     width="180">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="carCode"
                                     label="搅拌车"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="driver"
                                     label="司机"
                                     width="150">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip
                                     prop="pumpDeviceName"
                                     label="泵送设备"
                                     width="150">
                    </el-table-column>
                    <el-table-column fixed="right"
                                     label="操作"
                                     width="240">
                        <template scope="scope">
                            <el-button icon="el-icon-edit" size="medium" type="primary"
                                       @click="showEditDialog(scope.row)">修改
                            </el-button>
                            <el-popconfirm title="确定作废该任务单吗？" @confirm="delIndent(scope.row.id)">
                                <el-button icon="el-icon-delete" size="medium" type="danger" slot="reference">作废
                                </el-button>
                            </el-popconfirm>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination background
                               @size-change="handleSizeChange"
                               @current-change="handleCurrentChange"
                               :page-sizes="[50, 100, 200,500]"
                               :page-size="tableSearch.limit"
                               :current-page.sync="tableSearch.pageIndex"
                               layout="total,sizes, prev, pager, next"
                               :total="tableSearch.total">
                </el-pagination>
            </template>
        </el-main>
    </el-container>
    <template>
        <el-dialog :title="dialog.title" :visible.sync="dialog.show" width="95%" center v-loading="dialog.loading"
                   :close-on-click-modal="0" :show-close="0" custom-class="invoice-dialog">
            <el-form label-position="right" label-width="140px" :inline="true" :model="invoiceForm"
                     :rules="invoiceRules" ref="invoiceForm">
                <el-form-item label="任务单编号" prop="render.indentId" required class="indent-code">
                    <el-select v-model="invoiceForm.exhibition.indentCode" clearable filterable placeholder="任务单编号"
                               :disabled="dialog.update">
                        <el-option v-for="item in indentList"
                                   :key="item.id"
                                   :label="item.site"
                                   :value="item.id"
                                   @click.native="indentChange(item)">
                            <span style="float: left">{{item.conName}}-{{item.site}}
                            </span>
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="施工部位" class="indent-site">
                    <el-input v-model="invoiceForm.exhibition.site" readonly></el-input>
                </el-form-item>
                <el-form-item label="合同名称">
                    <el-input v-model="invoiceForm.exhibition.conName" readonly></el-input>
                </el-form-item>
                <el-form-item label="客户名称">
                    <el-input v-model="invoiceForm.exhibition.clientName" readonly></el-input>
                </el-form-item>
                <el-form-item label="施工单位">
                    <el-input v-model="invoiceForm.exhibition.builder" readonly></el-input>
                </el-form-item>
                <el-form-item label="施工部位">
                    <el-input v-model="invoiceForm.exhibition.site" readonly></el-input>
                </el-form-item>
                <el-form-item label="强度等级">
                    <el-input v-model="invoiceForm.exhibition.strengthName" readonly></el-input>
                </el-form-item>
                <el-form-item label="塌落度">
                    <el-input v-model="invoiceForm.exhibition.slumps" readonly></el-input>
                </el-form-item>
                <el-form-item label="特性要求">
                    <el-input v-model="invoiceForm.exhibition.tech" readonly></el-input>
                </el-form-item>
                <el-form-item label="浇筑方式">
                    <el-input v-model="invoiceForm.exhibition.castModelName" readonly></el-input>
                </el-form-item>
                <br>
                <!--  需要录入的信息  -->
                <el-form-item label="生产方式" required>
                    <el-select v-model="invoiceForm.render.proType" filterable clearable placeholder="生产方式"
                               value-key="id">
                        <el-option v-for="item in proTypeList"
                                   :key="item.code"
                                   :label="item.desc"
                                   :value="item.code + ''">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="发货类型" required>
                    <el-select v-model="invoiceForm.render.invoiceType" filterable clearable placeholder="发货类型"
                               value-key="id">
                        <el-option v-for="item in invoiceTypeList"
                                   :key="item.code"
                                   :label="item.desc"
                                   :value="item.code + ''">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="发货方量" required>
                    <el-input v-model="invoiceForm.render.sendStere"></el-input>
                </el-form-item>
                <el-form-item label="生产线">
                    <el-select v-model="invoiceForm.render.mixId" filterable clearable placeholder="生产线"
                               value-key="id">
                        <el-option v-for="item in mixList"
                                   :key="item.id"
                                   :label="item.name"
                                   :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="生产时间" required>
                    <el-date-picker v-model="invoiceForm.render.proTime" class="invoice-time"
                                    value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="生产时间">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="是否累计" required>
                    <el-radio-group v-model="invoiceForm.render.isAdd">
                        <el-radio label="0">累计</el-radio>
                        <el-radio label="1">不累计</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="是否过磅称重" required>
                    <el-radio-group v-model="invoiceForm.render.isWeight">
                        <el-radio label="0">需要</el-radio>
                        <el-radio label="1">不需要</el-radio>
                    </el-radio-group>
                </el-form-item>
                <br>
                <el-form-item label="调度员" required>
                    <el-select v-model="invoiceForm.render.dispatcherName" filterable clearable placeholder="调度员"
                               value-key="id">
                        <el-option v-for="item in dispatcherList"
                                   :key="item.id"
                                   :label="item.name"
                                   :value="item.name"
                                   @click.native="dispatcherChange(item)">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="拌台操作员" required>
                    <el-select v-model="invoiceForm.render.mixUserName" filterable clearable placeholder="拌台操作员"
                               value-key="id">
                        <el-option v-for="item in mixUserList"
                                   :key="item.id"
                                   :label="item.name"
                                   :value="item.name"
                                   @click.native="mixUserChange(item)">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="车号" required>
                    <el-select v-model="invoiceForm.render.carId" filterable clearable placeholder="车号"
                               value-key="id">
                        <el-option v-for="item in carList"
                                   :key="item.id"
                                   :label="item.code"
                                   :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="司机">
                    <el-input v-model="invoiceForm.render.driver"></el-input>
                </el-form-item>
                <el-form-item label="是否计算运输方量" required>
                    <el-radio-group v-model="invoiceForm.render.calcTranStere">
                        <el-radio label="0">计算</el-radio>
                        <el-radio label="1">不计算</el-radio>
                    </el-radio-group>
                </el-form-item>
                <br>
                <el-form-item label="票据类型">
                    <el-select v-model="invoiceForm.render.receiptType" filterable clearable placeholder="票据类型"
                               value-key="id">
                        <el-option v-for="item in receiptTypeList"
                                   :key="item.code"
                                   :label="item.desc"
                                   :value="item.code + ''">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="特殊结算类型">
                    <el-select v-model="invoiceForm.render.specialClearType" filterable clearable placeholder="特殊结算类型"
                               value-key="id">
                        <el-option v-for="item in specialClearTypeList"
                                   :key="item.code"
                                   :label="item.desc"
                                   :value="item.code + ''">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="道路类型">
                    <el-select v-model="invoiceForm.render.roadType" filterable clearable placeholder="道路类型"
                               value-key="id">
                        <el-option v-for="item in roadTypeList"
                                   :key="item.code"
                                   :label="item.desc"
                                   :value="item.code + ''">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="备注" class="invoice-remark">
                    <el-input type="textarea" :rows="2" v-model="invoiceForm.render.remark"></el-input>
                </el-form-item>
                <el-form-item label="运输备注" class="invoice-remark">
                    <el-input type="textarea" :rows="2" v-model="invoiceForm.render.tranRemark"></el-input>
                </el-form-item>
                <el-form-item label="泵送备注" class="invoice-remark">
                    <el-input type="textarea" :rows="2" v-model="invoiceForm.render.pumpRemark"></el-input>
                </el-form-item>

            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="onSubmit('invoiceForm')">确定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>
    </template>
</div>
</body>
<script type="text/javascript" th:src="@{/static/console/assets/js/jquery-3.2.1.min.js}"></script>
<script type="text/javascript" th:src="@{/static/console/js/pages/base.js}" charset="utf-8"></script>
<script type="text/javascript" th:src="@{/static/js/vue.min.js}"></script>
<script type="text/javascript" th:src="@{/static/js/element/index.js}"></script>
<script type="text/javascript" th:src="@{/static/console/datepicker/jquery-datePicker.js}" charset="utf-8"></script>
<script th:inline="javascript">

</script>
<script type="text/javascript" th:src="@{/static/console/js/pages/production/invoice.js?version=202211210945}"
        charset="utf-8"></script>

</html>